package com.scott.customer.controller;

import com.scott.customer.service.RabbitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

/**
 * @author guanjiwei
 */

@RestController("/rabbit")
public class RabbitController {
    @Autowired
    RabbitService rabbitService;

    @GetMapping("/")
    public void getMsg() throws IOException, TimeoutException {
        this.rabbitService.getMsg();
    }
    @GetMapping("/update")
    public void getMsgUpdate() throws IOException, TimeoutException {
        this.rabbitService.getMsgDirect();
    }
}
